/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "OFFICE_ITEMS_COLLAR")
public class OfficeItemsCollar extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "办公用品领用";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_WPID = "物品id";
	public static final String ALIAS_LYR = "领用人";
	public static final String ALIAS_LYRQ = "领用日期";
	public static final String ALIAS_SL = "数量";
	public static final String ALIAS_FFR = "发放人";
	public static final String ALIAS_LYBM = "领用部门";
	public static final String ALIAS_TJSJ = "系统时间";
	public static final String ALIAS_BZ = "备注";
	public static final String ALIAS_LYRMC = "领用人名称";
	public static final String ALIAS_FFRMC = "发放人名称";
	public static final String ALIAS_DEPTNAME = "部门名称";
	
	//date formats
	public static final String FORMAT_LYRQ = DATE_FORMAT;
	public static final String FORMAT_TJSJ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	
	private Long id;
    /**
     * 物品id       db_column: WPID 
     */ 	
	
	private Long wpid;
    /**
     * 领用人       db_column: LYR 
     */ 	
	
	private Long lyr;
    /**
     * 领用日期       db_column: LYRQ 
     */ 	
	
	private java.util.Date lyrq;
    /**
     * 数量       db_column: SL 
     */ 	
	
	private Long sl;
    /**
     * 发放人       db_column: FFR 
     */ 	
	
	private Long ffr;
    /**
     * 领用部门       db_column: LYBM 
     */ 	
	
	private Long lybm;
    /**
     * 系统时间       db_column: TJSJ 
     */ 	
	
	private java.util.Date tjsj;
    /**
     * 备注       db_column: BZ 
     */ 	
	@Length(max=500)
	private java.lang.String bz;
	/**
     * 领用人名称       db_column: LYRMC 
     */ 	
	@Length(max=30)
	private java.lang.String lyrmc;
    /**
     * 发放人名称       db_column: FFRMC 
     */ 	
	@Length(max=30)
	private java.lang.String ffrmc;
    /**
     * 部门名称       db_column: DEPTNAME 
     */ 	
	@Length(max=30)
	private java.lang.String deptname;
	//columns END


	public OfficeItemsCollar(){
	}

	public OfficeItemsCollar(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "WPID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getWpid() {
		return this.wpid;
	}
	
	public void setWpid(Long value) {
		this.wpid = value;
	}
	
	@Column(name = "LYR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getLyr() {
		return this.lyr;
	}
	
	public void setLyr(Long value) {
		this.lyr = value;
	}
	
	@Transient
	public String getLyrqString() {
		return DateConvertUtils.format(getLyrq(), FORMAT_LYRQ);
	}
	public void setLyrqString(String value) {
		setLyrq(DateConvertUtils.parse(value, FORMAT_LYRQ,java.util.Date.class));
	}
	
	@Column(name = "LYRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getLyrq() {
		return this.lyrq;
	}
	
	public void setLyrq(java.util.Date value) {
		this.lyrq = value;
	}
	
	@Column(name = "SL", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getSl() {
		return this.sl;
	}
	
	public void setSl(Long value) {
		this.sl = value;
	}
	
	@Column(name = "FFR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getFfr() {
		return this.ffr;
	}
	
	public void setFfr(Long value) {
		this.ffr = value;
	}
	
	@Column(name = "LYBM", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getLybm() {
		return this.lybm;
	}
	
	public void setLybm(Long value) {
		this.lybm = value;
	}
	
	@Transient
	public String getTjsjString() {
		return DateConvertUtils.format(getTjsj(), FORMAT_TJSJ);
	}
	public void setTjsjString(String value) {
		setTjsj(DateConvertUtils.parse(value, FORMAT_TJSJ,java.util.Date.class));
	}
	
	@Column(name = "TJSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getTjsj() {
		return this.tjsj;
	}
	
	public void setTjsj(java.util.Date value) {
		this.tjsj = value;
	}
	
	@Column(name = "BZ", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getBz() {
		return this.bz;
	}
	
	public void setBz(java.lang.String value) {
		this.bz = value;
	}
	
	@Column(name = "LYRMC", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getLyrmc() {
		return this.lyrmc;
	}
	
	public void setLyrmc(java.lang.String value) {
		this.lyrmc = value;
	}
	
	@Column(name = "FFRMC", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getFfrmc() {
		return this.ffrmc;
	}
	
	public void setFfrmc(java.lang.String value) {
		this.ffrmc = value;
	}
	
	@Column(name = "DEPTNAME", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getDeptname() {
		return this.deptname;
	}
	
	public void setDeptname(java.lang.String value) {
		this.deptname = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Wpid",getWpid())
			.append("Lyr",getLyr())
			.append("Lyrq",getLyrq())
			.append("Sl",getSl())
			.append("Ffr",getFfr())
			.append("Lybm",getLybm())
			.append("Tjsj",getTjsj())
			.append("Bz",getBz())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof OfficeItemsCollar == false) return false;
		if(this == obj) return true;
		OfficeItemsCollar other = (OfficeItemsCollar)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	private String wpmc;
	private String wpxh;
	private String wpgg;
	private String dataname;
	private Long lb;


	@Transient
	public Long getLb() {
		return lb;
	}

	public void setLb(Long lb) {
		this.lb = lb;
	}

	@Transient
	public String getDataname() {
		return dataname;
	}

	public void setDataname(String dataname) {
		this.dataname = dataname;
	}

	@Transient
	public String getWpgg() {
		return wpgg;
	}

	public void setWpgg(String wpgg) {
		this.wpgg = wpgg;
	}

	@Transient
	public String getWpmc() {
		return wpmc;
	}

	public void setWpmc(String wpmc) {
		this.wpmc = wpmc;
	}

	@Transient
	public String getWpxh() {
		return wpxh;
	}

	public void setWpxh(String wpxh) {
		this.wpxh = wpxh;
	}
	
}

